# Contributor: Alex Yam <alex@alexyam.com>
# Maintainer: Alex Yam <alex@alexyam.com>
pkgname=xcb-imdkit
pkgver=1.0.5
pkgrel=0
pkgdesc="X input method support for XCB"
url="https://github.com/fcitx/xcb-imdkit"
arch="all"
license="LGPL-2.1-only"
makedepends="
	cmake
	extra-cmake-modules
	samurai
	uthash-dev
	xcb-util-keysyms-dev
	"
subpackages="$pkgname-dev"
source="https://github.com/fcitx/xcb-imdkit/archive/$pkgver/xcb-imdkit-$pkgver.tar.gz"

build() {
	CFLAGS="$CFLAGS -flto=auto" \
	cmake -B build -G Ninja -Wno-dev \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DUSE_SYSTEM_UTHASH=ON
	cmake --build build
}

check() {
	cd build/test
	ctest -VV
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="
72ab16b97efa4ba185430a1e06829ab73dc6980d5577895bd0150c9eb83339d2f414b495319f926ebff5e53521244ac47323de316fd559ccee3bf9bbcf77ce4a  xcb-imdkit-1.0.5.tar.gz
"
